package com.qianfeng.smartdevice.mapper;
import com.qianfeng.smartdevice.pojo.SysScene;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @time: 2022-03-21 19:50
 */
public interface SysSceneMapper {
    @Insert("insert into sys_scene(scene_name,create_by,create_time) values(#{sceneName},#{createBy},#{createTime})")
    void addSysScene(SysScene sysScene);
    @Select("select * from sys_scene where create_by=#{userId} and scene_name=#{sceneName}")
    SysScene findByUserAndName(@Param("userId") Long userId, @Param("sceneName") String sceneName);
    @Update("update sys_scene set status=#{status} where scene_id=#{sceneId}")
    int updateStatus(@Param("sceneId") Long sceneId,@Param("status") Long status);
    @Select("select * from sys_scene where scene_id=#{id}")
    SysScene findById(Long id);
}